Fix @SupportedLanguage
directive for articles
#1318
+82
−14
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Bug/issue #, if applicable: rdar://160284853
Summary
The
@SupportedLanguage
directive allows specifying a language that an article is available in. It can be used within the@Metadata
directive like in the below example, where the article is made available in both Swift and Objective-C:This directive is processed when creating the topic graph node for the article. In cases where the article is the root page or a standalone article (when no technology root is defined), the directive is correctly processed as a part of registering the article in the documentation cache. However, in the case of a non-root article in a catalog containing a root article, this step was being skipped. This patch fixes this to ensure that the directive is processed for all articles in a catalog.
Dependencies
N/A
Testing
Unit tests have been added to test this functionality when creating the documentation node and reference for articles containing the directive.
Checklist
Make sure you check off the following items. If they cannot be completed, provide a reason.
./bin/test
script and it succeeded